﻿@{
    Layout = "~/Views/Shared/_ListLayout.cshtml";
}
@inherits CMSWebViewPage<object>
<div id="toolbar_loginfo" class="datagrid-toolbar">
    @CurrentButtonTool.Create()
    <div>
        <form id="fr_search_loginfo">
            @Html.QueryDateTimeBox("记录时间", "LogDate")
            -
            @Html.QueryDateTimeBox("", "LogDate", QueryMethod.LessEqual, QueryDataType.DateTime)
            @Html.QueryComboBox("模块类型", "ModuleType", QueryMethod.Equal, QueryDataType.String,"/LogInfo/LogModuleList")
            <a href="javascript:void(0)" onclick="Search();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">Search</a>
        </form>
    </div>
</div>
<table id="dg_loginfo" data-options="url:'/loginfo/listjson?LcIds=@TransferID',border:false,fit:true,fitColumns:true,toolbar:'#toolbar_loginfo',singleSelect:true,pagination:true,pageSize:20">
    <thead>
        <tr>
            <th data-options="field:'ck',checkbox:true"></th>
            <th data-options="field:'Id',width:40,align:'center'">Id</th>
            <th data-options="field:'LogName',width:50,align:'center'">名称</th>
            <th data-options="field:'LogType',width:50,align:'center'">日志类型</th>
            <th data-options="field:'ModuleType',width:50,align:'center'">模块类型</th>
            <th data-options="field:'LogTitle',formatter:FormatLogTitle,width:220,align:'center'">标题</th>
            <th data-options="field:'RequestUrl',formatter:FormatRequestUrl,width:220,align:'center'">请求地址</th>
            <th data-options="field:'LogDate',formatter:JsonToDate,width:100,align:'center'">记录时间</th>
        </tr>
    </thead>
</table>
@section Bottom{
    <script type="text/javascript">
        var objBizDatagrid = new BizDatagrid('#dg_loginfo');
        function ClearLog() {
            TransferToUrl("/loginfo/clearlog");
        }
        function Search() {
            objBizDatagrid.search('#fr_search_loginfo', '/loginfo/listjson?LcIds=@TransferID');
        }
        function Delete() {
            objBizDatagrid.del('/loginfo/delete/');
        }
        function FormatLogTitle(val, row) {
            //return "<a href='/loginfo/detailpage?id=" + row.Id + "'>" + row.LogTitle + "</a>";
            return "<a href='javascript:TransferToUrl(&quot;/loginfo/detailpage?id=" + row.Id + "&quot;);'>" + row.LogTitle + "</a>";
        }
        function FormatRequestUrl(val, row) {
            return "<a href='" + row.RequestUrl + "'>" + row.RequestUrl + "</a>";
        }
    </script>
}
